input = r"C:\Users\Tamir\Documents\Thesis\git\data\view-source as-rank.caida.org  data-selected=2013-04-01&n=100&ranksort=1&mode0=as-ranking.htm"
output = r"C:\Users\Tamir\Documents\Thesis\git\data\ASRanking.rank"

import csv

with open(input,'rb') as file:
    content = file.read()
content = str(content)
sp = content.split('as=')
spsp = sp[1::4]
ases = list(map(lambda st: st[:st.index('&')], spsp))

with open(output,'w') as file:
    csv_writer = csv.writer(file)
    csv_writer.writerow(ases)